/* SubtitleStylePanel.css */

.subtitle-style-panel {
    display: flex;
    flex-direction: column;
    background: #23272e;
    color: #f0f0f0;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.18);
    padding: 16px;
    height: 100%;
    min-height: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
}

.subtitle-style-panel::-webkit-scrollbar {
    width: 8px;
}
.subtitle-style-panel::-webkit-scrollbar-track {
    background: #1c1c1c;
}
.subtitle-style-panel::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 4px;
}

.subtitle-style-panel h3 {
    font-size: 14px;
    font-weight: 600;
    color: #c0c0c0;
    margin: 0 0 16px 0;
    padding: 0;
    border-bottom: 1px solid #333;
    padding-bottom: 8px;
}

.style-list {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.style-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    margin-bottom: 8px;
    background: #2a2e35;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: background 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
}

.style-item:hover {
    background: #30343c;
}

.style-item.selected {
    background: #353a42;
    border-color: #0078d4;
}

.style-item span {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: #f0f0f0;
}

.button-group {
    display: flex;
    gap: 8px;
}

.subtitle-style-panel button {
    background: #0078d4;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
    min-width: 60px;
    overflow-y: auto; /* 保留这个滚动条 */
}

.subtitle-style-panel button:hover {
    background: #0063b1;
}

.subtitle-style-panel button.cancel {
    background: #555;
}
.subtitle-style-panel button.cancel:hover {
    background: #777;
}

.empty-style-list {
    text-align: center;
    color: #888;
    padding: 20px 0;
}

.empty-style-list button {
    margin-top: 10px;
}

.edit-panel {
    background: #1c1c1c;
    padding: 16px;
    border-radius: 8px;
    margin-top: 16px;
    /* 移除 flex 和 overflow，让它与父容器一起滚动 */
}

.edit-panel h3 {
    font-size: 16px;
    color: #f0f0f0;
    margin-bottom: 16px;
    border-bottom: none;
    padding-bottom: 0;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    color: #c0c0c0;
    font-size: 13px;
    gap: 8px;
}

.form-group label > span {
    flex-shrink: 0;
    width: 70px;
    text-align: right;
}

.edit-panel input[type="text"],
.edit-panel input[type="number"],
.edit-panel select {
    /* 移除 flex: 1，改为固定宽度 */
    width: 80px; /* Reduced width from 100px to 80px */
    background: #2a2e35;
    border: 1px solid #444;
    color: #f0f0f0;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    outline: none;
    transition: border-color 0.2s ease;
}

.edit-panel input[type="text"]:focus,
.edit-panel input[type="number"]:focus,
.edit-panel select:focus {
    border-color: #0078d4;
}

.edit-panel input[type="checkbox"] {
    accent-color: #0078d4;
    margin-left: auto;
    margin-right: 0;
}

.color-input-group {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-height: 32px; /* 确保足够的高度 */
}

.color-input-group input[type="color"] {
    width: 40px;
    height: 30px;
    padding: 2px;
    border: 1px solid #444;
    border-radius: 4px;
    background: transparent;
    cursor: pointer;
}

.alpha-control {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.alpha-label {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
    min-width: 40px;
}

.alpha-value {
    font-size: 11px;
    color: #aaa;
    min-width: 35px;
    text-align: right;
    font-family: 'Courier New', monospace;
}

.color-input-group input[type="range"] {
    flex: 1;
    margin: 0;
    padding: 0;
    height: 8px; /* 稍微增加高度 */
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, 
        rgba(0,0,0,0.8) 0%, 
        rgba(255,255,255,0.2) 25%, 
        rgba(255,255,255,0.5) 50%, 
        rgba(255,255,255,0.8) 75%, 
        rgba(255,255,255,1) 100%
    ); /* 更明显的透明度渐变 */
    border: 1px solid #555;
    border-radius: 4px;
    cursor: pointer;
    position: relative;
}

/* 添加棋盘格背景来更好地显示透明度 */
.color-input-group input[type="range"]:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(45deg, #333 25%, transparent 25%),
        linear-gradient(-45deg, #333 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #333 75%),
        linear-gradient(-45deg, transparent 75%, #333 75%);
    background-size: 8px 8px;
    background-position: 0 0, 0 4px, 4px -4px, -4px 0px;
    border-radius: 3px;
    z-index: -1;
}

.color-input-group input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 18px; /* 稍微增大滑块 */
    height: 18px;
    border-radius: 50%;
    background: #0078d4;
    cursor: pointer;
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    position: relative;
    z-index: 1;
}

.color-input-group input[type="range"]::-webkit-slider-thumb:hover {
    background: #106ebe;
    transform: scale(1.1);
    transition: all 0.2s ease;
}

.ass-color-preview {
    font-family: 'Courier New', Courier, monospace;
    font-size: 12px;
    color: #aaa;
    width: 80px;
    text-align: right;
    flex-shrink: 0;
}

.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.edit-panel-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 20px;
    border-top: 1px solid #333;
    padding-top: 16px;
}